import axios from './axios'
import qs from 'qs'
import { apiUrl, appUrl } from '@/config/config'
// 根据时间查询学生的课堂答题信息
export const getStudentDailyAnswer = (params) => {
  return new Promise((resolve, reject) => {
    axios({
      url: apiUrl + '/student-daily-report/answer/getStudentDailyAnswer',
      method: 'get',
      params
    }).then(res => {
      resolve(res.data)
    }).catch(err => {
      reject(err)
    })
  })
}
// 获取学生指定时间段行踪列表
export const getTimeList = (params) => {
  return new Promise((resolve, reject) => {
    axios({
      url: apiUrl + '/student-daily-report/student/gps/trace/list',
      method: 'get',
      params
    }).then(res => {
      resolve(res.data)
    }).catch(err => {
      reject(err)
    })
  })
}
// 获取学生指定时间段gps轨迹热力图
export const getMap = (params) => {
  return new Promise((resolve, reject) => {
    axios({
      url: apiUrl + '/student-daily-report/student/gps/trail/map/to/student',
      method: 'get',
      params
    }).then(res => {
      resolve(res.data)
    }).catch(err => {
      reject(err)
    })
  })
}
// 根据时间查询学生消费统信息
export const getStatistics = (params) => {
  return new Promise((resolve, reject) => {
    axios({
      url: apiUrl + '/student-daily-report/consume/getStatistics',
      method: 'get',
      params
    }).then(res => {
      resolve(res.data)
    }).catch(err => {
      reject(err)
    })
  })
}
// 获取学生当日评价
export const getEvaluateList = (params) => {
  return new Promise((resolve, reject) => {
    axios({
      url: apiUrl + '/student-daily-report/student/assess/list',
      method: 'get',
      params
    }).then(res => {
      resolve(res.data)
    }).catch(err => {
      reject(err)
    })
  })
}
// 获取学生详情
export const getStudentDetail = (params) => {
  return new Promise((resolve, reject) => {
    axios({
      url: appUrl + '/bdc/api/app/student',
      method: 'get',
      params
    }).then(res => {
      resolve(res.data)
    }).catch(err => {
      reject(err)
    })
  })
}
// 获取学校详情
export const getSchoolDetail = (params) => {
  return new Promise((resolve, reject) => {
    axios({
      url: appUrl + `/bdc/api/app/school/${params}/detail`,
      method: 'get'
    }).then(res => {
      resolve(res.data)
    }).catch(err => {
      reject(err)
    })
  })
}